﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="DonDatHang.aspx.cs" Inherits="SES.CMS.DonDatHang" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="lbl" runat="server"></asp:Label>
    <asp:GridView runat="server" ID="GridGioHang" AutoGenerateColumns="False" EmptyDataText="Không có dữ liệu !"
        AllowPaging="True" OnPageIndexChanging="GridGioHang_PageIndexChanging" 
        CellPadding="4" Width="679px" BackColor="White" BorderColor="#CC9966" BorderStyle="None"
        BorderWidth="1px" onrowdatabound="GridGioHang_RowDataBound" 
        DataKeyNames="DonHangID" ondatabinding="GridGioHang_DataBinding" 
        ondatabound="GridGioHang_DataBound"  ShowFooter="false" >
        <RowStyle BackColor="White" ForeColor="#330099" />
        <Columns>
            <asp:TemplateField HeaderText="STT">
                <ItemTemplate>
                    <%# Container.DataItemIndex + 1 %>     
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            
            <asp:BoundField DataField="TenSanPham" HeaderText="Tên SP" />
                        
            <asp:TemplateField HeaderText="Số Lượng">
                <ItemTemplate>
                    <asp:Label runat="server" ID="txtSL" Text='<%#DataBinder.Eval(Container.DataItem,"SoLuong") %>'>
                    </asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" />
            </asp:TemplateField>
            
            <asp:TemplateField HeaderText="Đơn Giá">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lbDG" Text='<%#DataBinder.Eval(Container.DataItem,"DonGia") %>'>
                    </asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Giảm Giá">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lbGG" Text='<%#DataBinder.Eval(Container.DataItem,"GiamGia") %>'>
                    </asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Thành tiền">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lbTT" Text='<%#DataBinder.Eval(Container.DataItem,"TongTien") %>'>
                    </asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="White" ForeColor="#000066" />
        <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
    </asp:GridView>

    <br />
    <asp:Label ID="lblSum" runat="server"></asp:Label>
<div align="center" style="margin-top: 15px;" class="ltr">
    <asp:Label ID="lbThanhtoan" runat="server"></asp:Label>
 </div>		<br />
 <div align="center" style="margin-top: 15px;" class="ltr dGioHang">
    <a href="/Default.aspx"  class="continue_link">Trở về trang chủ</a>
    
        <div style="margin-top: 40px;">
        <hr />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div class="SP">
                    Sản phẩm bán chạy<img src="/images/temp.jpg" align="top" width="575px" alt="tem" />
                    <asp:Repeater ID="rpt" runat="server" OnItemCommand="rpt_ItemCommand">
                        <ItemTemplate>
                            <div class="product-box">
                                <div class="product-img">
                                    <a href="<%#"/SanPhamChiTiet/"+Eval("SanPhamID")+"/"+FriendlyUrl(Eval("TenSanPham").ToString())%>">
                                        <img src="/Media/<%#Eval("HinhAnh")%>" /></a>
                                    <asp:Button CommandArgument='<%#Eval("SanPhamID")%>' runat="server" ID="btDatMua"
                                        Text="ĐẶT MUA" Width="90px" BorderWidth="0px" CssClass="btn" Height="25px" BackColor="#009345" />
                                </div>
                                <div class="product-detail">
                                    <div style="float: left; width: 120px; height: 95px;">
                                        <a href="<%#"/SanPhamChiTiet/"+Eval("SanPhamID")+"/"+FriendlyUrl(Eval("TenSanPham").ToString())%>">
                                            <%#Eval("TenSanPham")%></a>
                                        <div class="dMota">
                                            <%#Eval("Mota")%></div>
                                    </div>
                                    <div style="float: left; color: #c20b47; font-size: 12px; text-transform: uppercase">
                                        Giá:
                                        <%#(bool)(Int64.Parse(Eval("DonGia").ToString())==0)?"Liên hệ":Eval("DonGia","{0:0,0} VNĐ")%>
                                    </div>
                                </div>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                    <asp:Label runat="server" Text="" ID="lbThongbao"></asp:Label>
                </div>
                <div style="width: 100%; float: left; margin-top: 10px;">
                    <div style="float: left;">
                        <asp:ImageButton ID="cmdPrev" Visible="false" OnClick="cmdPrev_Click" runat="server"
                            ImageUrl="~/images/prevpage.png" /></div>
                    <div style="float: right;">
                        <asp:ImageButton ID="cmdNext" Visible="false" OnClick="cmdNext_Click" runat="server"
                            ImageUrl="~/images/nextpage.png" /></div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
